package com.xbongbong.pro.dynamic.pojo.dto;

import com.xbongbong.saas.domain.entity.CustomerUserEntity;
import com.xbongbong.sys.domain.entity.UserEntity;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 *退回公海池并且退出负责团队
 *
 *@author weijianxun
 */
@Setter
@Getter
@ToString
@Accessors(chain = true)
public class DynamicBackAndExitTeamDTO implements Serializable {
    private static final long serialVersionUID = -6746410175810812562L;

    private String corpid;

    /**
     * 操作人
     */
    private UserEntity creator;

    private List<Long> customerIds;

    private Map<Long, StringBuffer> customerIdToUserNameMap;

    private Map<Long, List<CustomerUserEntity>> customerIdToUserMap;

    /**
     * 手动退出
     * @param corpid
     * @param creator
     * @param customerIdToUserNameMap
     * @return
     */
    public static DynamicBackAndExitTeamDTO initBackAndExitTeamDTO(String corpid, UserEntity creator, List<Long> customerIds, Map<Long, StringBuffer> customerIdToUserNameMap) {
        return new DynamicBackAndExitTeamDTO().setCorpid(corpid).setCreator(creator).setCustomerIds(customerIds).setCustomerIdToUserNameMap(customerIdToUserNameMap);
    }

    /**
     * 公海规则退出
     * @param corpid
     * @param creator
     * @param customerIdToUserMap
     * @return
     */
    public static DynamicBackAndExitTeamDTO initScriptBackAndExitTeamDTO(String corpid, UserEntity creator, List<Long> customerIds, Map<Long, List<CustomerUserEntity>> customerIdToUserMap) {
        return new DynamicBackAndExitTeamDTO().setCorpid(corpid).setCreator(creator).setCustomerIds(customerIds).setCustomerIdToUserMap(customerIdToUserMap);
    }

    /**
     * 员工离职退出
     * @param corpid
     * @param creator
     * @param customerIds
     * @param customerIdToUserMap
     * @return
     */
    public static DynamicBackAndExitTeamDTO initLeaveBackAndExitTeamDTO(String corpid, UserEntity creator, List<Long> customerIds, Map<Long, List<CustomerUserEntity>> customerIdToUserMap) {
        return new DynamicBackAndExitTeamDTO().setCorpid(corpid).setCreator(creator).setCustomerIds(customerIds).setCustomerIdToUserMap(customerIdToUserMap);
    }
}
